<?php

// Define path to application directory
defined('APPLICATION_PATH')
    || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));

// Define application environment
defined('APPLICATION_ENV')
    || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));

// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
    realpath(APPLICATION_PATH . '/../../library'),
    get_include_path(),
)));

/** Zend_Application */
require_once 'Zend/Application.php';
require_once 'Zend/Registry.php';
require_once 'Zend/Db/Adapter/Pdo/Mysql.php';
require_once 'Zend/Config.php';
require_once 'Zend/Config/Ini.php';


/** Database */
/* $dbcon=array(
		'host'=>'mysql3.000webhost.com',
		'dbname'=>'a5991676_vnt',
		'username'=>'a5991676_vnt',
		'password'=>'Abcd1234'
);
 */
$dbcon=array(
	'host'=>'localhost',
	'dbname'=>'zend',
	'username'=>'root',
	'password'=>'root'
);

/** Config */
// Get config from config.php file.
$config = new Zend_Config(require APPLICATION_PATH . '/config.php');
// Get config from config.ini file.
$config = new Zend_Config_Ini(APPLICATION_PATH . '/config.ini', 'app');
$title=$config->title;
$dbcon=$config->database->toArray();
// Set DB object.
$DB = new Zend_Db_Adapter_Pdo_Mysql($dbcon);
// $DB->setFetchMode(Zend_Db::FETCH_OBJ);
Zend_Registry::set('title', $title);
Zend_Registry::set("DB", $DB);
Zend_Registry::set('number', array('mot,hai,ba'));


// Create application, bootstrap, and run
$application = new Zend_Application(
    APPLICATION_ENV,
    APPLICATION_PATH . '/configs/application.ini'
);
$application->bootstrap()
            ->run();